﻿using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CommunityToolkitMvvmDemo
{
    public class WavePack
    {
        public static double MinWaveLength { get; set; } = 190;
        public static double MaxWaveLength { get; set; } = 1100;
        public event Action WaveLengthChanged;
        private double waveLength;
        public double WaveLength 
        {
            get => waveLength;
            set
            {
                if(value == waveLength) return;
                if(value < MinWaveLength) value = MinWaveLength;
                if(value > MaxWaveLength) value = MaxWaveLength;
                //SetProperty(ref waveLength, value);
                waveLength = value;
                WaveLengthChanged?.Invoke();
            }
        }
        
        public double Parameter {  get; set; }
    }
}
